<template>
  <div class="container">
    <!-- header -->
    <div class="header" v-if="$slots.title">
      <slot name="title"></slot>
    </div>

    <!-- main -->
    <div class="box">
      <div class="box-item" v-for="item in list" :key="item.id">
        <div class="left">
          <slot name="left" :row="item">左侧 </slot>
        </div>
        <div class="right">
          <slot name="right" :row="item">右侧 </slot>
        </div>
      </div>
    </div>
    <!-- main E -->
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
    },
    list: {
      type: Array,
    },
  },
};
</script>

<style scoped lang="less">
/* 头部 */
.container {
  background: white;
  width: 400px;
  border-radius: 5px;
  margin: 10px;
}
.box {
  padding: 10px;
    width: 230px;
    height: 300px;
    
  .box-item {
    height: 50px;
    border-bottom: 1px solid rgb(240, 240, 240);
    display: flex;
    align-items: center;
    justify-content: space-between;
    .right {
      display: flex;
      align-items: center;
    }
  }
  .box-item:last-child {
    border-bottom: none;
  }

}
.header {
    font-size: 13px;
  width: 230px;
  border-radius: 5px 5px 0 0;
  color: white;
  display: flex;
  align-items: center;
  height: 50px;
  padding-left: 30px;
  font-weight: bold;
//   background-color: gold;
  background: linear-gradient(to right, gold, white);
}
</style>